<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function* add(){
            console.log('start');
            let x = yield '2';
            console.log('one:'+x);
            let y = yield '3';
            console.log('two'+y);
        }

        const f1 = add();
        console.log(f1.next());
        console.log(f1.next(20));
        console.log(f1.next(30));
    </script>
</body>
</html>